checkCookie();

function getCookie(c_name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return unescape(y);
        }
    }
}

function setCookie(c_name, value, exdays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
    document.cookie = c_name + "=" + c_value;
}

function checkCookie() {
    var username = getCookie("username");
    if (username != null && username != "") {
        //alert("Welcome again " + username);

        if (username == 0) {
            setCookie("username", 1, 365);
            var ads300 = '<script  src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=300X250&cwpid=550231&cwwidth=300&cwheight=250&cwpnet=1&cwtagid=138310"></script>';
        }
        if (username == 1) {
            setCookie("username", 2, 365);
            var ads300 = '<script  src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=300X250&cwpid=550231&cwwidth=300&cwheight=250&cwpnet=1&cwtagid=138310"></script>';

        }
        if (username == 2) {
            setCookie("username", 0, 365);
            var ads300 = '<script  src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=300X250&cwpid=550231&cwwidth=300&cwheight=250&cwpnet=1&cwtagid=138310"></script>';
        }

    }
    else {
        username = "1";
        if (username != null && username != "") {
            setCookie("username", username, 365);
            var ads300 = '<script  src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=300X250&cwpid=550231&cwwidth=300&cwheight=250&cwpnet=1&cwtagid=138310"></script>';
        }

    }
    var ads_shreeji_300 = ('<style type="text/css">#Shreejiinfo1 { margin-left:auto; margin-right:auto; width:300px; height:250px;}' +
'    #Shreejiinfo1 #ShreejiAd1 { margin-left:auto;  margin-right:auto;  margin-top:0px;  margin-bottom:0px;  height:250px}</style>' +
'    <div id="Shreejiinfo1"><div id="ShreejiAd1">' + ads300 + '</div></div>');

    document.write(ads_shreeji_300);
}


//var ads_shreeji_300 = ('<style type="text/css">#Shreejiinfo1 { margin-left:auto; margin-right:auto; width:300px; height:250px;}' +
//'    #Shreejiinfo1 #ShreejiAd1 { margin-left:auto;  margin-right:auto;  margin-top:0px;  margin-bottom:0px;  height:250px}</style>' +
//'    <div id="Shreejiinfo1"><div id="ShreejiAd1">' +
//'<a href="http://www.anrdoezrs.net/click-6324946-10864024" target="_blank">' +
//'<img src="http://www.awltovhc.com/image-6324946-10864024" width="300" height="250" alt="Save Up to 90% on SSL Certificates from Go Daddy!" border="0"/></a>' +
//'</div></div>');

//document.write(ads_shreeji_300);

